﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects;
using System.Data.EntityClient;
using Hengbei.DAL.Models;

namespace Hengbei.DAL
{
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    public partial class HengbeiContext : ObjectContext
    {
        #region Constructors

        /// <summary>
        /// Initializes a new HengbeiEntities object using the connection string found in the 'HengbeiEntities' section of the application configuration file.
        /// </summary>
        public HengbeiContext()
            : base("name=HengbeiEntities", "HengbeiEntities")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }

        /// <summary>
        /// Initialize a new HengbeiEntities object.
        /// </summary>
        public HengbeiContext(string connectionString)
            : base(connectionString, "HengbeiEntities")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }

        /// <summary>
        /// Initialize a new HengbeiEntities object.
        /// </summary>
        public HengbeiContext(EntityConnection connection)
            : base(connection, "HengbeiEntities")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }

        #endregion

        #region Partial Methods

        partial void OnContextCreated();

        #endregion

        #region ObjectSet Properties

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        //public ObjectSet<User> Users
        //{
        //    get
        //    {
        //        if ((_Users == null))
        //        {
        //            _Users = base.CreateObjectSet<User>("Users");
        //        }
        //        return _Users;
        //    }
        //}
        //private ObjectSet<User> _Users;

        #endregion
        #region AddTo Methods

        /// <summary>
        /// Deprecated Method for adding a new object to the Users EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        //public void AddToUsers(User user)
        //{
        //    base.AddObject("Users", user);
        //}

        #endregion
    }
}
